package com.hardydou.system.model;

import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;
import java.util.Date;


/**
 * @author ：hardy
 * @description：SystemRes
 * @date ：Created in 2020-03-11
 * @Copyright ：Hardydou.com
 */
public class SystemRes extends BaseModel implements GrantedAuthority {
    private Long resId;

    private Long parentId;

    private String resName;

    private String resPath;

    private String resType;

    private String resMark;

    private Integer order;

    private String target;

    private boolean visible;

    private String icon;

    private static final long serialVersionUID = 1L;

    public Long getResId() {
        return resId;
    }

    public void setResId(Long resId) {
        this.resId = resId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getResName() {
        return resName;
    }

    public void setResName(String resName) {
        this.resName = resName == null ? null : resName.trim();
    }

    public String getResPath() {
        return resPath;
    }

    public void setResPath(String resPath) {
        this.resPath = resPath == null ? null : resPath.trim();
    }

    public String getResType() {
        return resType;
    }

    public void setResType(String resType) {
        this.resType = resType == null ? null : resType.trim();
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target == null ? null : target.trim();
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon == null ? null : icon.trim();
    }


    @Override
    public String getAuthority() {
        return getResMark();
    }


    public String getResMark() {
        return resMark;
    }

    public void setResMark(String resMark) {
        this.resMark = resMark;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", resId=").append(resId);
        sb.append(", parentId=").append(parentId);
        sb.append(", resName=").append(resName);
        sb.append(", resPath=").append(resPath);
        sb.append(", resType=").append(resType);
        sb.append(", resMark=").append(resMark);
        sb.append(", order=").append(order);
        sb.append(", target=").append(target);
        sb.append(", visible=").append(visible);
        sb.append(", icon=").append(icon);
        sb.append(super.toString());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}